package com.world.wifi.service.impl;

import java.util.List;
import com.world.common.utils.DateUtils;
import com.world.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.world.wifi.mapper.WifiCostMapper;
import com.world.wifi.domain.WifiCost;
import com.world.wifi.service.IWifiCostService;

/**
 * 计费信息Service业务层处理
 * 
 * @author LiJunXi
 * @date 2025-05-27
 */
@Service
public class WifiCostServiceImpl implements IWifiCostService 
{
    @Autowired
    private WifiCostMapper wifiCostMapper;

    /**
     * 查询计费信息
     * 
     * @param costId 计费信息主键
     * @return 计费信息
     */
    @Override
    public WifiCost selectWifiCostByCostId(Long costId)
    {
        return wifiCostMapper.selectWifiCostByCostId(costId);
    }

    /**
     * 查询计费信息列表
     * 
     * @param wifiCost 计费信息
     * @return 计费信息
     */
    @Override
    public List<WifiCost> selectWifiCostList(WifiCost wifiCost)
    {
        return wifiCostMapper.selectWifiCostList(wifiCost);
    }

    /**
     * 新增计费信息
     * 
     * @param wifiCost 计费信息
     * @return 结果
     */
    @Override
    public int insertWifiCost(WifiCost wifiCost)
    {
        wifiCost.setUserId(SecurityUtils.getUserId());
        wifiCost.setCreateTime(DateUtils.getNowDate());
        return wifiCostMapper.insertWifiCost(wifiCost);
    }

    /**
     * 修改计费信息
     * 
     * @param wifiCost 计费信息
     * @return 结果
     */
    @Override
    public int updateWifiCost(WifiCost wifiCost)
    {
        return wifiCostMapper.updateWifiCost(wifiCost);
    }

    /**
     * 批量删除计费信息
     * 
     * @param costIds 需要删除的计费信息主键
     * @return 结果
     */
    @Override
    public int deleteWifiCostByCostIds(Long[] costIds)
    {
        return wifiCostMapper.deleteWifiCostByCostIds(costIds);
    }

    /**
     * 删除计费信息信息
     * 
     * @param costId 计费信息主键
     * @return 结果
     */
    @Override
    public int deleteWifiCostByCostId(Long costId)
    {
        return wifiCostMapper.deleteWifiCostByCostId(costId);
    }
}
